Description:
To improve reliability of your code, always use arrays of zero length instead of null references. This will allow you to get rid of additional checks for null values to avoid null reference exceptions being thrown. RZLA verifies that methods returning array types never return null values.
Incorrect:
string[] GetLangList() {
if (connection == null) {
return null;
}
...
}
Correct:
string[] GetLangList() {
if (connection == null) {
return new string[] {};
}
...
}